<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var setting = {
            check: {
                enable: true,
                autoCheckTrigger: true
            },
            async: {
                enable: true,
                dataType: "json",
                url: "/menu/getMenuZtreeChecked/" + $("#roleId").val(),
                autoParam: ["id", "name"]
            }
        };

        $(document).ready(function(){
            $.fn.zTree.init($("#treeDemo"), setting);
        });
    </script>
</head>
<body>
<form class="form-horizontal" role="form" id="updateRoleForm">
    <input type="hidden" name="roleId" th:value="${r.roleId}" id="roleId">
    <div class="form-group">
        <label for="roleName" class="col-sm-2 control-label">角色名称</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" id="roleName" th:value="${r.roleName}" name="roleName" placeholder="请输角色名字">
        </div>
    </div>
    <div class="form-group">
        <label for="menu" class="col-sm-2 control-label">权限</label>
        <div class="col-sm-5">
            <div class="zTreeDemoBackground left" id="menu">
                <ul id="treeDemo" class="ztree"></ul>
            </div>
        </div>
    </div>
</form>
</body>
</html>